
************************************************************************
* Replication material for "The role of structural factors and         *
* diffusion in social unrest: evidence from the Swing Riots"  *
*                                                                      *
* Aidt and Leon (2020)                                                 *
************************************************************************


********************************************************
* This file produces Figure A1 in the online appendix: *
* "Distribution of distances to newspapers"            *
********************************************************

clear
sysdir set PERSONAL "C:\Users\k1466170\Documents\ado"
sysdir set PLUS "C:\Users\k1466170\Documents\ado"

* Delete or change the following as appropriate:
cd "C:\Users\k1466170\Documents\Great Reform riots\UK riots\Data\Parish Names\Hobsbawm\replication material - BJPolS"

use "newspaper_distribution.dta"

* Set plotting scheme
set scheme plotplainblind

twoway kdensity news_dist if allriotsX==1, lpattern(dash)  || kdensity news_dist if allriotsX>0


kdensity news_dist, nograph generate(x fx)
kdensity news_dist if allriotsX==0, nograph generate(fx0) at(x)
kdensity news_dist if allriotsX>1, nograph generate(fx1) at(x)
label var fx0 "no riots"
label var fx1 "riots"
line fx0 fx1 x, sort ytitle(Density) xtitle(Distance to nearest newspaper)